import Vue from 'vue'
import { Toast } from 'vant'

Vue.use(Toast)

const defaultLabel = '值'

export const messages = {
  REQUIRED_INPUT: (label = defaultLabel) => `请输入${label}`,
  REQUIRED_SELECT: (label = defaultLabel) => `请选择${label}`,
  REQUIRED_UPLOAD: (label = defaultLabel) => `请上传${label}`,
  PATTERN: (label = defaultLabel) => `请输入正确的${label}`,

  PASSWORD_LENGTH: (min = 8, max = 16) => `密码长度为${min}到${max}位`,
  PASSWORD_STRENGTH: '密码强度不够',
  PASSWORD_DISTINCT: '两次密码不一致',

  COPY_SUCCESS: '复制到剪贴板'
}

export const toast = value => Toast(value)
